class FullDateJoins < ActiveRecord::Migration
  def self.up

    create_table :artist_dates do |t|
      t.integer :artist_id, :null => false
      t.integer :full_date_id, :null => false
      t.string :event, :null => false
    end

    create_table :membership_dates do |t|
      t.integer :membership_id, :null => false
      t.integer :full_date_id, :null => false
      t.string :event, :null => false
    end

    add_foreign_key(:artist_dates, :artists, :column => :artist_id)
    add_foreign_key(:artist_dates, :full_dates, :column => :full_date_id)
    add_foreign_key(:membership_dates, :memberships, :column => :membership_id)
    add_foreign_key(:membership_dates, :full_dates, :column => :full_date_id)
  end

  def self.down
    drop_table :artist_dates
    drop_table :membership_dates
  end
end
